<g:javascript>
    function getSelText()
    {
    var txt = '';
    if (window.getSelection)
    {
    txt = window.getSelection();
    }
    else if (document.getSelection)
    {
    txt = document.getSelection();
    }
    else if (document.selection)
    {
    txt = document.selection.createRange().text;
    }
    else return;
    return  txt;
    }
    
    function tooltipPopup(e){
      var tooltip = document.getElementById('tooltip')
      //var key = getSelText()
      tooltip.innerHTML = e.responseText
      if(tooltip.innerHTML.length>0){
      tooltip.style.visibility='visible'
      }else{
      tooltip.style.visibility='hidden'
      }
    }
    </g:javascript>
<div class="tooltip">
  <table style="margin: 0px;bottom: 0px;border: 0px">
    <tr> 
      <th>Tooltip</th>
    </tr>
    <tr>
      <td><div id="tooltip" style="word-wrap: break-word;max-width: 160px"/></td>
    </tr>
  </table>
</div>